import { FreightAccountComponent } from './components/freight-account/freight-account.component';
import { DriverAccountComponent } from './components/driver-account/driver-account.component';
import { RechargeRecordComponent } from './components/recharge-record/recharge-record.component';
import { WithdrawalsRecordComponent } from './components/withdrawals-record/withdrawals-record.component';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { FreightAccountDetailComponent } from './components/freight-account/freight-account-detail/freight-account-detail.component';
import { DriverAccountDetailComponent } from './components/driver-account/driver-account-detail/driver-account-detail.component';
import { WithdrawalsDetailComponent } from './components/withdrawals-record/withdrawals-detail/withdrawals-detail.component';
import { CostManagementComponent } from './components/cost-management/cost-management.component';
import { AbnormalGoldComponent } from './components/abnormal-gold/abnormal-gold.component';
import { PaymentRecordComponent } from './components/payment-record/payment-record.component';
import { TransactionFlowComponent } from './components/transaction-flow/transaction-flow.component';
import { CostManagementDetailComponent } from './components/cost-management/cost-management-detail/cost-management-detail.component';
import { ExpensesReceivableComponent } from './components/cost-management/expenses-receivable/expenses-receivable.component';
import { ExpensesPayableComponent } from './components/cost-management/expenses-payable/expenses-payable.component';
import { PaymentOrderComponent } from './components/payment-order/payment-order.component';
import { ReceiptOrderComponent } from './components/receipt-order/receipt-order.component';
import { VoucherManagementComponent } from './components/voucher-management/voucher-management.component';
import { VoucherSummaryComponent } from './components/voucher-summary/voucher-summary.component';
import { ReceivableOrderComponent } from './components/receivable-order/receivable-order.component';
import { PayableOrderComponent } from './components/payable-order/payable-order.component';
import { ReceivableOrderDetailComponent } from './components/receivable-order/receivable-order-detail/receivable-order-detail.component';
import { PayableOrderDetailComponent } from './components/payable-order/payable-order-detail/payable-order-detail.component';
import { VoucherDetailComponent } from './components/voucher-management/voucher-detail/voucher-detail.component';
import { SummaryDetailComponent } from './components/voucher-summary/summary-detail/summary-detail.component';
import { VoucherListComponent } from './components/voucher-summary/voucher-list/voucher-list.component';
import { ReceiptOrderDetailComponent } from './components/receipt-order/receipt-order-detail/receipt-order-detail.component';
import { PaymentOrderDetailComponent } from './components/payment-order/payment-order-detail/payment-order-detail.component';
import { PlatformAccountComponent } from './components/platform-account/platform-account.component';
import { PlatformAccountDetailComponent } from './components/platform-account/platform-account-detail/platform-account-detail.component';
import { AdvanceCollectionComponent } from './components/advance-collection/advance-collection.component';
import { AdvanceCollectionDetailComponent } from './components/advance-collection/advance-collection-detail/advance-collection-detail.component';
import { RefundRecordComponent } from './components/refund-record/refund-record.component';
import { AbnormalGoldDetailComponent } from './components/abnormal-gold/abnormal-gold-detail/abnormal-gold-detail.component';
import { CwcBankCardManagementIndexComponent } from './components/bank-card-management/index/index.component';

const routes: Routes = [
  { path: 'freight-account', component: FreightAccountComponent, data: { guard: { ability: ['FINANCIAL-FREIGHT-ACOUNT-list'] } } },
  {
    path: 'freight-account/detail/:id',
    component: FreightAccountDetailComponent,
    data: { guard: { ability: ['FINANCIAL-FREIGHT-ACOUNT-DETAIL-view'] } }
  },
  { path: 'driver-account', component: DriverAccountComponent, data: { guard: { ability: ['FINANCIAL-DRIVER-ACOUNT-list'] } } },
  {
    path: 'driver-account/detail/:id',
    component: DriverAccountDetailComponent,
    data: { guard: { ability: ['FINANCIAL-DRIVER-ACOUNT-DETAIL-view'] } }
  },
  { path: 'platform-account', component: PlatformAccountComponent, data: { guard: { ability: ['FINANCIAL-PLATFORM-list'] } } },
  {
    path: 'platform-account/detail/:id',
    component: PlatformAccountDetailComponent,
    data: { guard: { ability: ['FINANCIAL-PLATFORM-DETAIL-detail'] } }
  },
  { path: 'recharge-record', component: RechargeRecordComponent, data: { guard: { ability: ['FINANCIAL-RECHARGE-list'] } } },
  { path: 'withdrawals-record', component: WithdrawalsRecordComponent, data: { guard: { ability: ['FINANCIAL-WITHDRAWALS-list'] } } },
  { path: 'withdrawals-record/detail/:id', component: WithdrawalsDetailComponent },
  { path: 'refund-record', component: RefundRecordComponent },
  { path: 'voucher-management', component: VoucherManagementComponent, data: { guard: { ability: ['FINANCIAL-VOUCHER-list'] } } },
  { path: 'voucher-management/detail/:id', component: VoucherDetailComponent },
  { path: 'voucher-summary', component: VoucherSummaryComponent, data: { guard: { ability: ['FINANCIAL-VOUCHER-SUMMARY-list'] } } },
  { path: 'voucher-summary/detail/:id', component: SummaryDetailComponent },
  { path: 'voucher-summary/list/:id', component: VoucherListComponent },
  { path: 'voucher-summary/list/detail/:id', component: VoucherDetailComponent },
  { path: 'cost-management', component: CostManagementComponent, data: { guard: { ability: ['FINANCIAL-COST-list'] } } },
  {
    path: 'cost-management/detail/:id',
    component: CostManagementDetailComponent,
    data: { guard: { ability: ['FINANCIAL-COST-DETAIL-view'] } }
  },
  { path: 'cost-management/expenses-receivable/:id', component: ExpensesReceivableComponent },
  { path: 'cost-management/expenses-payable/:id', component: ExpensesPayableComponent },
  { path: 'abnormal-gold', component: AbnormalGoldComponent , data: { guard: { ability: ['FINANCIAL-ABNORMAL-list'] } } },
  { path: 'abnormal-gold/detail/:id', component: AbnormalGoldDetailComponent },
  { path: 'payment-record', component: PaymentRecordComponent },
  { path: 'transaction-flow', component: TransactionFlowComponent , data: { guard: { ability: ['FINANCIAL-TRANSACTION-list'] } } },
  { path: 'payment-order', component: PaymentOrderComponent, data: { guard: { ability: ['FINANCIAL-PAYMENT-ORDER-list'] } } },
  { path: 'payment-order/detail/:id', component: PaymentOrderDetailComponent },
  { path: 'receipt-order', component: ReceiptOrderComponent, data: { guard: { ability: ['FINANCIAL-RECEIPT-list'] } } },
  { path: 'receipt-order/detail/:id', component: ReceiptOrderDetailComponent },
  { path: 'advance-collection', component: AdvanceCollectionComponent },
  { path: 'advance-collection/detail/:id', component: AdvanceCollectionDetailComponent },
  { path: 'receivable-order', component: ReceivableOrderComponent, data: { guard: { ability: ['FINANCIAL-RECEIVABLE-list'] } } },
  {
    path: 'receivable-order/detail/:id',
    component: ReceivableOrderDetailComponent,
    data: { guard: { ability: ['FINANCIAL-RECEIVABLE-DETAIL-view'] } }
  },
  { path: 'payable-order', component: PayableOrderComponent, data: { guard: { ability: ['FINANCIAL-PAYABLE-list'] } } },
  {
    path: 'payable-order/detail/:id',
    component: PayableOrderDetailComponent,
    data: { guard: { ability: ['FINANCIAL-PAYABLE-DETAIL-view'] } }
  },
  { path: 'bank-card-management/index', component: CwcBankCardManagementIndexComponent }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class FinancialManagementRoutingModule {}
